package com.asin.domain;

public class Person  {
    //成员变量
    private String name;
    private int age;
    public String address;


    //-------构造方法-------
    public Person(){}

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    private Person(String name){
        this.name = name;
    }

    protected Person(int age){
        this.age = age;
    }

    //-------get和set方法-------
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    ////-------其他成员方法-------
    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    private int work(int hour){
        System.out.println(name+"一天工作"+hour+"小时");
        return hour*100; //日薪
    }

    public static void run(){
        System.out.println("静态的跑步方法");
    }

}

